<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class Article_request extends Request
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
                'title'=>'required|min:3',
                'content'=>'required',
            ];
    }

    /**
     * 自定义的错误返回信息
     * @return array
     */
    public function message(){
        return [
            'title.required'=>'标题不能为空',
            'title.min'=>'标题至少大于:min个字符',
            'content.required'=>'文章内容不能为空',
        ];
    }
}
